<?php
namespace Home\Controller;

use Think\Controller;
use Think\View;
use Think\Model;
/**
 * 前端部分
 */
class FrontController extends Controller {
	//查看首页
	public function front(){
		$this->display('front/index');
	}
	//关于我们页面
	public function about(){
		$data = $this->getzxlist ();//获取资讯
		// var_dump($data);
		$this->assign ( array (
				'zxdata' => $data
		) );
		$data = $this->gethtlist ();//获取话题
		// var_dump($data);
		$this->assign ( array (
				'htdata' => $data
		) );
		$this->display('front/about');
	}
	//联系我们页面
	public function contact(){
		$this->display('front/contact');
	}
	//查看房源
	public function projects(){
		$data = $this->getjslist ();//获取资讯
		//var_dump($data);
		$this->assign ( array (
				'jsdata' => $data
		) );
		$this->display('front/projects');
	}
	//优质服务页面
	public function services(){
		$this->display('front/services');
	}
	// 获取新闻列表
	private function getzxlist() {
		// $newsobj = M('news');
		$this->newsobj = new \Home\Model\newsModel ();
		return $this->newsobj->findzx_orderby_dateline ();
	}
	//获取话题
	private function gethtlist() {
		// $newsobj = M('news');
		$this->newsobj = new \Home\Model\newsModel ();
		return $this->newsobj->findht_orderby_dateline ();
	}
	
	//获取海邻+介绍
	private function getjslist() {
		// $newsobj = M('news');
		$this->newsobj = new \Home\Model\newsModel ();
		return $this->newsobj->findjs_orderby_dateline ();
	}
}